// DatabaseManager.h: interface for the DatabaseManager class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_DATABASEMANAGER_H__815F41A2_9B59_4074_A67E_78E94CE5254F__INCLUDED_)
#define AFX_DATABASEMANAGER_H__815F41A2_9B59_4074_A67E_78E94CE5254F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "CommonLib\DatabaseHelper.h"
#include "CommonLib\Structure.h"

#include "Ado.h"

class DatabaseManager : public DatabaseHelper
{
protected:
	DatabaseManager();
	virtual ~DatabaseManager();

	void QueryDefaultOptions();

public:
	static DatabaseManager * Instance();
	static void DeleteInstance();

	virtual bool CreateDSN();
	virtual LPCTSTR GetConnect();
	virtual bool Init();

	const Options& GetDefaultOptions() const {return m_Options;}

	CAdoConnection * GetpAdoConnection() {return m_pAdoConnection;}
	CAdoConnection * GetpAdoConnection0() {return m_pAdoConnection0;}
	CAdoConnection * GetpAdoConnection1() {return m_pAdoConnection1;}
	CAdoConnection * GetpAdoConnection2() {return m_pAdoConnection2;}

	CAdoConnection m_adoConnection;
	CAdoConnection m_adoConnection0;
	CAdoConnection m_adoConnection1;
	CAdoConnection m_adoConnection2;
	CAdoRecordSet  m_adoRecordSet;

protected:
	Options m_Options;

private:
	static DatabaseManager * m_pInstance;
	CAdoConnection * m_pAdoConnection;
	CAdoConnection * m_pAdoConnection0;
	CAdoConnection * m_pAdoConnection1;
	CAdoConnection * m_pAdoConnection2;
};

#endif // !defined(AFX_DATABASEMANAGER_H__815F41A2_9B59_4074_A67E_78E94CE5254F__INCLUDED_)
